<?php
include_once("../configure/admin.config.inc.php");	//--> admin global var
include_once("db.inc.php");							//--> db global var
include_once("Smarty.class.php");					//--> out template
include_once("Orders.php");							//--> Orders
include_once("Operation.php");						//--> Operation

require_once("controlHeader.php");					//--> system control header

$objOperate 	= new Operation();							//--> Operation
$objOrders		= new Orders(DB_TAG_PUBLIC, $uid);		//--> Orders

$error_message 	= '';

$arrOperate = $objOperate->arrGetFromGroupIDAndMenuID($gid, $menuid);


$arrOrders 	= $objOrders->getByID($arrOperate, $id);

$myStore	= $objOrders->getRow(DB_TAG_PUBLIC, "SELECT c.title, c.values FROM configuration c, configuration_group g WHERE c.groupID=g.id AND g.title = 'My Store' AND c.keyes = 'STORE_NAME_ADDRESS'");

$arrDataList 	= $objOrders->listCustom(DB_TAG_PUBLIC, '*', "orders_products WHERE ordersID=$id", '', 0, 100, '');
//$arrAccountList = $objOrders->listCustom(DB_TAG_PUBLIC, '*', "orders_Account WHERE ordersID=$id", " ORDER BY classes", 0, 100, '');
//$arrStatusList 	= $objOrders->listCustom(DB_TAG_PUBLIC, '*', "orders_Status_history WHERE ordersID=$id", " ORDER BY id", 0, 100, '');
//$arrAttributes 	= $objOrders->listCustom(DB_TAG_PUBLIC, '*', "orders_products_attributes WHERE ordersID=$id", " ORDER BY id", 0, 100, '');

/*----- out html -----*/
$smarty = new Smarty();	//----- out template
$smarty->template_dir = TEMPLATE_SYS_DIR;
$smarty->compile_dir  = CACHE_SYS_DIR;

$smarty->assign('error_message', $error_message);
$smarty->assign('menuGid', $menuGid);
$smarty->assign('menuid', $menuid);

$smarty->assign('backurl',$backurl);

$smarty->assign('id', $id);

$smarty->assign('myStore', $myStore);


$smarty->assign('arrOrders', $arrOrders);
$smarty->assign('arrDataList', $arrDataList);
//$smarty->assign('arrAccountList', $arrAccountList);
//$smarty->assign('arrStatusList', $arrStatusList);

$smarty->display('listOrders_Packingslip.htm');
?>
